﻿namespace RL
{
    using System;
    using System.ComponentModel;

    public abstract class BaseSorter : ExpandableObjectConverter
    {
        protected string[] SortOrder;

        protected BaseSorter()
        {
        }

        public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object value, Attribute[] attributes)
        {
            return TypeDescriptor.GetProperties(value, attributes).Sort(this.SortOrder);
        }

        public override bool GetPropertiesSupported(ITypeDescriptorContext context)
        {
            return true;
        }
    }
}

